home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / thor / ProcessEvents.lha / processevents13 / ProcessEvents13.install < prev    next >
Text File  |  1996-11-17  |  18KB  |  403 lines

  1. ; ProcessEvents.br V1.3 Installer ©1996 Roy E Brown
  2.  
  3. ; $VER: ProcessEvents.install 1.3 (17.11.96)
  4.  
  5. ;*****************************************************************************************
  6.  
  7.  (set #vers "V1.3")
  8.  
  9.  (set #lf "\n")
  10.  
  11.  (run "SetEnv THOR/THORPATH \"`GetEnv THOR/THORPATH`*N\"")
  12.  
  13.  (set #ThorPath (getenv "Thor/ThorPath"))
  14.   
  15.  (set #ThorPath (substr #Thorpath 0 (- (strlen #ThorPath) 1)))
  16.  
  17.  (set #RealPath (expandpath #ThorPath))
  18.   
  19.  (set @default-dest (cat #realpath "/rexx/bbsread"))
  20.  
  21.  (set #docpath (cat #RealPath "/docs"))
  22.  
  23.  (if (exists "Env:Thor" (noreq)) (message (cat "\n"
  24.                                   "Welcome to ProcessEvents "#vers" for Thor.\n\n"
  25.                                   "This script will install ProcessEvents "#vers
  26.                                   " into your\n\n "@default-dest" directory.\n\n"
  27.                                   "It will then help you to create the\n"
  28.                                   "required ProcessEvents configuration file.\n\n"
  29.                                   "Please read the 'Help' comments with each option.\n\n"
  30.                                   "© 1996 Roy E Brown")
  31.                                  )
  32.                                ( (message (cat "\nYou do not have Thor V2.4 "
  33.                                   "installed.\nProcessEvents is of no use to you.\n\n"
  34.                                   "Thor\n© 1993-1995 Ultima Thule Software"))
  35.                                   (exit (quiet))
  36.                                )
  37.  )
  38.  
  39.  (set #oldfile (tackon @default-dest "ProcessEvents.br"))
  40.  
  41.  (set #vernum (getversion #oldfile))
  42.  (set #ver (/ #vernum 65536))
  43.  (set #rev (- #vernum (* #ver 65536)))
  44.  
  45.  (set #version (+ (* 10 #ver) #rev))
  46.  
  47. ;**** START OF GET-CONFIGURATION PROCEDURE ***********************************************
  48.  
  49. (procedure P_Configure
  50.  
  51.  (set #con (askbool (prompt (cat "\n"
  52.                "In order to use ProcessEvents.br "#vers", we need\n"
  53.                "to create a configuration file. By entering\n"
  54.                "the correct details during this installation\n"
  55.                "process, the configuration file will created\n"
  56.                "and stored in the ENVARC:Thor directory\n\n"
  57.                "Do you wish to continue?")
  58.                )
  59.                (help "")
  60.                (choices "Configure" "Exit")
  61.             )
  62.   )
  63.   (if (= #con 0) (exit (quiet)) (set #nop "nop"))
  64.  
  65.  (set #SystemName (askstring (prompt "\nPlease enter the name of your TCP system in Thor\n"
  66.                                      "e.g. 'Internet', 'Demon', 'Kevin' etc.\n")
  67.                              (help (cat "This is the name of your TCP system as configured "
  68.                                         "when setting up Thor using the System Configuration "
  69.                                         "option. Examples:\n\n"
  70.                                         " 'Internet' \n"
  71.                                         " 'Demon'    \n"
  72.                                         " 'Bloggs'   \n\n"
  73.                                         "or whatever wierd and wonderful name you have thought "
  74.                                         "of to call your TCP system.")
  75.                              )
  76.                              (default "Internet")
  77.                   )
  78.   )
  79.  
  80.   (set #MT (askchoice (prompt "\nPlease select your type of mail system.\n")
  81.                       (help (cat "This is the type of Mail system that you use with your ISP. "
  82.                             "The options are either POP3 or SMTP.\n\n"
  83.                             "'Demon Internet Services' users should set this to SMTP unless "
  84.                             "they are paying Demon extra to have a POP3 mailbox.\n\n"
  85.                             "Users of other ISPs should consult with their provider if they "
  86.                             "are not sure which system they are using.")
  87.                       )
  88.                       (choices "SMTP" "POP3")
  89.            )
  90.    )
  91.  
  92.   (set #MailType (select #MT "SMTP" "POP3"))
  93.  
  94.   (select #MT (set #MF (askstring (prompt (cat "\n"
  95.                                    "Please enter your mailbox filename  \n"
  96.                                    "This must be the same as you entered\n"
  97.                                    "in the Thor TCP Systems config.   \n\n"
  98.                                    "The default is the variable Env:USER\n")
  99.                                    )
  100.                                    (help (cat "This is the is the name of the file created when you receive "
  101.                                          "new mail.\n\nIt is normally located in UUMAIL: which is normally "
  102.                                          "assigned when you run your 'Startnet' script.\n\n It should also "
  103.                                          "be the same as you have set in the 'mailpacket' entry in the "
  104.                                          "Thor Systems Configuration")
  105.                                    )
  106.                                    (default (getenv "USER"))
  107.                        )
  108.               )
  109.   (set #MF "")
  110.   )
  111.  
  112.   (select #MT (set #MB (askdir (prompt "Please confirm the location of your mail download directory. "
  113.                                 "It is usually assigned as \"UUMAIL:\"\n")
  114.                                (help (cat "This is the directory assigned by your 'Startnet' script.\n\n"
  115.                                "It is normally \"AmiTCP:usr/mail/\"")
  116.                                )
  117.                                (default "UUMAIL:")
  118.                        )
  119.               )
  120.   (set #MB "")
  121.   )
  122.  
  123.   (set #MailBox (cat #MB #MF))
  124.  
  125.   (set #Maxtries (asknumber (prompt "\nPlease enter the number of times you wish\n"
  126.                                     "ProcessEvents to retry to collect mail and news")
  127.                             (help (cat "This is the number of times you want GetTCP and SendTCP to "
  128.                                        "attempt to connect with your mail/news servers.\n\n"
  129.                                        "If the servers are busy, ProcessEvents will keep trying to "
  130.                                        "connect for the number of times that you set in this variable.")
  131.                             )
  132.                             (range 1 100)
  133.                             (default 5)
  134.                  )
  135.   )
  136.  
  137.   (set #AP (askchoice (prompt "\nDo you want ProcessEvents to automatically parse\n"
  138.                               "new news and mail when collection is complete?\n")
  139.                       (help (cat "This will allow the user to decide whether to parse any new mail "
  140.                       "and/or news articles automatically once collection is complete - regardless "
  141.                       "of the \'LogOff\' variable setting.")
  142.                       )
  143.                       (choices "Autoparse" "Do not Autoparse")
  144.            )
  145.   )
  146.  
  147.   (set #Autoparse (select #AP "YES" "NO"))
  148.  
  149.   (set #LO (askchoice (prompt (cat "\nDo you want ProcessEvents to display the 'Log Off (Y/N)'\n"
  150.                               "requester once everything is complete?\n\n"
  151.                               "Please read the 'Help' comments.\n")
  152.                       )
  153.                       (help "If set to 'Log Off Requester' then ProcessEvents will display a "
  154.                             "requestor offering the option of whether to link down or not.\n\n"
  155.                             "NOTE: If you set this to 'Log Off Requester', you will still have to manually "
  156.                             "link down using the requester buttons. This variable only decides "
  157.                             "if you see the requester or not.\n\n"
  158.                             "If set to 'No Log Off Requester', then no requester will be shown and "
  159.                             "you will remain on-line.")
  160.                       (choices "No Log Off Requester" "Log Off Requester")
  161.            )
  162.   )
  163.  
  164.   (set #LogOff (select #LO "NO" "YES"))
  165.  
  166.   (set #LinkDown (askstring (prompt (cat "\nEnter the command that you use to 'link down'\n"
  167.                                     "i.e. to disconnect from your ISP. If necessary, include "
  168.                                     "the full pathname.\n")
  169.                             )
  170.                             (help (cat "This is your link down command or script. You should specify the "
  171.                                   "full command line that takes your system off-line.\n\n"
  172.                                   "Example: 'rx AmiTCP:bin/Link Down'\n"
  173.                                   "         'rx \"address MIAMI.1 OFFLINE\"'")
  174.                             )
  175.                             (default "rx \"address MIAMI.1 OFFLINE\"")
  176.                   )
  177.   )
  178.  
  179.  (set #ED (askchoice (prompt "Select your desired text editor")
  180.                      (help (cat"You should select your favourite EXTERNAL text editor here.\n\n"
  181.                      "This will be used should you wish to edit an Event prior to sending it.\n\n"
  182.                      "Both GoldED and CygnusEd have the 'STICKY' option attached. GoldED certainly needs "
  183.                      "it, but I am not sure about CygnusEd.\n\nThis script assumes that you are using the "
  184.                      "fast starters ('Ed') for GoldED and CygnusEd'.\n\nOf course, should you use a different "
  185.                      "editor, then select 'Other' and you will be able to enter your choice of text editor.")
  186.                      )
  187.                      (choices "GoldED" "CygnusEd" "Other")
  188.             )
  189.    )
  190.  
  191.  (set #Editor (select #ED "C:ED STICKY" "CED -keepio"
  192.                           (askfile (prompt "\nPlease select your external text editor\n")
  193.                                      (help (cat "Enter the name of your desired text editor, "
  194.                                      "including the full path if necessary. You may also need "
  195.                                      "a 'STICKY' type option to prevent a direct return to "
  196.                                      "ProcessEvents once called.")
  197.                                      (default "c:")
  198.                                      )
  199.                           )
  200.               )
  201.   )
  202.  
  203.  (set #ST (askchoice (prompt "Select your desired text viewer")
  204.                      (help (cat "You should selet your favourite text viewer here. This will enable "
  205.                      "you to view any mail or newsgroup Event prior to sending.\n\nIf your viewer is "
  206.                      "not listed, select 'Other' and you will be able to select your favourite text viewer")
  207.                      )
  208.                      (choices "MuchMore" "More" "Other")
  209.           )
  210.  )
  211.  (set #ShowText (select #ST "c:MuchMore" "c:More"
  212.                           (askfile (prompt "\nPlease select your external text viewer")
  213.                                      (help (cat "Enter the name of your desired text viewer, including "
  214.                                      "the full path if necessary.")
  215.                                      (default "C:")
  216.                                      )
  217.                           )
  218.               )
  219.   )
  220.  
  221.  (if (= #MailBox "") (set #MM "(Determined by main script)") (set #MM #MailBox))
  222.  
  223.  (set #check (askbool (prompt (cat "\n"
  224.              "Please check that you have entered\n"
  225.              "all details correctly.\n\n"
  226.              "Your Thor system = "#SystemName"\n"
  227.              "Your Mailtype = "#MailType"\n"
  228.              "Your Mailbox = "#MM"\n"
  229.              "Maxtries = "#Maxtries"\n"
  230.              "Autoparse = "#Autoparse"\n"
  231.              "LogOff = "#LogOff"\n"
  232.              "LinkDown = "#LinkDown"\n"
  233.              "EDITOR = "#Editor"\n"
  234.              "ShowText = "#ShowText)
  235.                       )
  236.                       (help "")
  237.                       (default 1)
  238.                       (choices "All Correct" "Start Again")
  239.              )
  240.  )
  241.  
  242.  (select #check (P_Configure)
  243.                 (set #NOP "NOP")
  244.  )
  245.  
  246.  (textfile (prompt "")
  247.            (help "")
  248.            (dest "T:ProcessEvents.temp")
  249.            (append "*** ProcessEvents Configuration File ***" #lf
  250.                    "CmdPath    " #RealPath #lf
  251.                    "SystemName " #SystemName #lf
  252.                    "MailType   " #Mailtype #lf
  253.                    "MailBox    " #Mailbox #lf
  254.                    "MaxTries   " #Maxtries #lf
  255.                    "AutoParse  " #Autoparse #lf
  256.                    "LogOff     " #LogOff #lf
  257.                    "LinkDown   " #Linkdown #lf
  258.                    "Editor     " #Editor #lf
  259.                    "ShowText   " #ShowText #lf
  260.                    "** END **" #lf #lf
  261.                    "Please DO NOT alter this file by hand")
  262.  )
  263.  
  264.  (set #configdir "ENVARC:Thor")
  265.  
  266.  (set #configfile (tackon #configdir "ProcessEvents.config"))
  267.  
  268.  (set #oldconfig (cat #configfile ".old"))
  269.  
  270.  (rename #configfile #oldconfig (prompt "")
  271.                                 (help "")
  272.  )
  273.  
  274.  (copyfiles (prompt (cat "\n"
  275.                          "(Your old configuration file has been\n"
  276.                          "renamed with the .old extension)\n"
  277.                          "The ProcessEvents.br configuration file\n"
  278.                          "will now be copied to:\n\n"#configdir"\n")
  279.             )
  280.             (help "")
  281.             (source "T:ProcessEvents.temp")
  282.             (dest #configdir)
  283.             (newname "ProcessEvents.config")
  284.             (confirm)
  285.             (nogauge)
  286.  )
  287.  
  288.  (delete "T:ProcessEvents.temp")
  289.  
  290. ; **** Everything is done - let's end it here and now ****
  291.  
  292.  (exit (cat "\n\nInstallation Complete\n\nProcessEvents has been installed in\n\n"
  293.             @default-dest
  294.           "\n\nIMPORTANT!\n\n"
  295.           "PLEASE RE-BOOT before using ProcessEvents "#vers".\n\n"
  296.           "All Copyrights are acknowledged") (quiet ))
  297. )
  298.  
  299. ; **** END OF GET CONFIGURATION PROCEDURE **********************************************
  300.  
  301. ; **** PROCEDURES USED FOR COPYING CORRECT FILES ****
  302.  
  303.  (procedure P_CopyBoth
  304.     (copyfiles (source "ProcessEvents13.br")
  305.                (dest @default-dest)
  306.                (newname "ProcessEvents.br")
  307.                (nogauge)
  308.     )
  309.     (copyfiles (source "ProcessEvents13.guide")
  310.                (dest #docpath)
  311.                (newname "ProcessEvents.guide")
  312.                (infos)
  313.                (nogauge)
  314.     )
  315.  )
  316.  
  317.  (procedure P_CopyPE
  318.     (copyfiles (source "ProcessEvents13.br")
  319.                (dest @default-dest)
  320.                (newname "ProcessEvents.br")
  321.                (nogauge)
  322.     )
  323.  )
  324.  
  325.  (procedure P_CopyGuide
  326.     (copyfiles (source "ProcessEvents13.guide")
  327.                (dest #docpath)
  328.                (newname "ProcessEvents.guide")
  329.                (infos)
  330.                (nogauge)
  331.     )
  332.  )
  333.  
  334. ; **** END OF COPYING PROCEDURES ************************************************
  335.  
  336. ; ***** Note to author: Change number on next line if version number changes *****
  337.  
  338.  (trap 4 (set #SZ (getsum (cat @default-dest "/ProcessEvents.br"))))
  339.  
  340.  (if (= #SZ -924007754) ( (set #UP(askbool (prompt "\nYou already have ProcessEvents Version "#vers" installed.\n\n"
  341.                                         "Do you wish to update the\nProcessEvents.br Configuration file?")
  342.                                         (help "")
  343.                                         (choices "Update" "Exit")
  344.                                )
  345.                        )
  346.                        (if (= #UP 0) (exit (quiet)) (P_Configure))
  347.                      )
  348.  
  349.                      ( (if (= #SZ 0) (set #cont (askbool
  350.                                                        (prompt "\nYou do not have ProcessEvents installed.\n\n"
  351.                                                        "Do you wish to continue and install\nProcessEvents "#vers"?")
  352.                                                        (help "")
  353.                                                      )
  354.                                           )
  355.                                           (set #cont (askbool (prompt ("\nYou currently have ProcessEvents Version %ld.%ld installed.\n\n" #ver #rev)
  356.                                           "Do you wish to continue and update to Version "#vers"?\n\n"
  357.                                           "(If you are updating from an earlier version, Please complete "
  358.                                           "the full installation process - there are "
  359.                                           "minor changes to the configuration file.)\n")
  360.                                                               (help "")
  361.                                                      )
  362.                                           )
  363.                        )
  364.                      )
  365.  )
  366.  
  367.  (if (= #cont 0) (exit (quiet)) (welcome))
  368.  
  369. ; **** Rename old file and copy new file to correct directory. ****
  370.  
  371. (set #fileold (cat #oldfile ".old"))
  372.  
  373. (if (exists #oldfile (noreq)) (rename #oldfile #fileold
  374.                                   (prompt (cat ("\nRename\n\n ProcessEvents.br V%ld.%ld\n\n" #ver #rev)
  375.                                                "to\n\nProcessEvents.br.old.\n\n"
  376.                                                "If you skip this part, your current\nfile will be overwritten.")
  377.                                   )
  378.                                   (help "")
  379.                                   (confirm)
  380.                                )
  381.                                (set #nop "nop")
  382.  )
  383.  
  384.  ;**** Ask user which files to copy ****
  385.  
  386.  (set #copy (askoptions (prompt "\nThe Installer will now copy the following files to the correct locations. "
  387.                                 "Please see 'Help' for details.\n")
  388.             (help "\n ProcessEvents.br will be copied to\n\n   "@default-dest"\n\n"
  389.                   "\n ProcessEvents.guide will be copied to\n\n   "#docpath)
  390.             (choices "ProcessEvents.br" "ProcessEvents.guide")
  391.            )
  392.  )
  393.  
  394.  (set #Proc (select #copy "" (P_CopyPE)(P_CopyGuide)(P_CopyBoth)))
  395.  
  396.  ;**** Call the correct copying procedure ****
  397.  
  398.  (#Proc)
  399.  
  400. ; **** Let's get all the details we need for the configuration file.****
  401.  
  402.  (P_Configure)
  403.